package com.tanhua.management.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;

public enum StateEnum implements IEnum<Integer> {

    //审核状态，1为待审核，2为自动审核通过，3为待人工审核，4为人工审核拒绝，5为人工审核通过，6为自动审核拒绝
    STATUS_ONE(1,"待审核"),
    STATUS_TWO(2,"自动审核通过"),
    STATUS_THREE(3,"待人工审核"),
    STATUS_FOUR(4,"人工审核拒绝"),
    STATUS_FIVE(5,"人工审核通过"),
    STATUS_SIX(6,"自动审核拒 绝");


    private Integer value;
    private String desc;

    StateEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    @Override
    public String toString() {
        return this.desc;
    }

    public static String getStatusByValue(Integer code) {
        String state = "未知";
        for (StateEnum stateEnum : values()) {
            if (stateEnum.value == code) {
                state = stateEnum.desc;
            }
        }
        return state;
    }
}
